﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.Skins;
using DevExpress.LookAndFeel;
using DevExpress.UserSkins;
using DevExpress.XtraBars;
using DevExpress.XtraBars.Ribbon;
using DevExpress.XtraBars.Helpers;


namespace DXW
{
    public partial class FrmMainControler : RibbonForm
    {
        public FrmMainControler()
        {
            InitializeComponent();
            InitSkinGallery();
        }
        void InitSkinGallery()
        {
            SkinHelper.InitSkinGallery(rgbiSkins, true);
        }

        private void btnExit_ItemClick(object sender, ItemClickEventArgs e)
        {
            foreach (var frm in MdiChildren) frm.Close();
        }

        private void FrmMainControler_FormClosed(object sender, FormClosedEventArgs e)
        {
        }

        private void btnBophan_ItemClick(object sender, ItemClickEventArgs e)
        {
            foreach (var x in MdiChildren) if (x is Catalog.FrmBophan) { x.Activate(); return; }
            var frm = new Catalog.FrmBophan() { MdiParent = this };
            frm.Show();
        }

        private void btnVitri_ItemClick(object sender, ItemClickEventArgs e)
        {
            foreach (var x in MdiChildren) if (x is Catalog.FrmVitri) { x.Activate(); return; }
            var frm = new Catalog.FrmVitri() { MdiParent = this };
            frm.Show();
        }

        private void btnTruong_ItemClick(object sender, ItemClickEventArgs e)
        {
            foreach (var x in MdiChildren) if (x is Catalog.FrmTruong) { x.Activate(); return; }
            var frm = new Catalog.FrmTruong() { MdiParent = this };
            frm.Show();
        }

        private void btnChuyennganh_ItemClick(object sender, ItemClickEventArgs e)
        {
            foreach (var x in MdiChildren) if (x is Catalog.FrmChuyennganh) { x.Activate(); return; }
            var frm = new Catalog.FrmChuyennganh() { MdiParent = this };
            frm.Show();
        }

        private void btnBangcap_ItemClick(object sender, ItemClickEventArgs e)
        {
            foreach (var x in MdiChildren) if (x is Catalog.FrmBangcap) { x.Activate(); return; }
            var frm = new Catalog.FrmBangcap() { MdiParent = this };
            frm.Show();
        }

        private void btnTrinhdo_ItemClick(object sender, ItemClickEventArgs e)
        {
            foreach (var x in MdiChildren) if (x is Catalog.FrmTrinhdo) { x.Activate(); return; }
            var frm = new Catalog.FrmTrinhdo() { MdiParent = this };
            frm.Show();
        }

        private void btnVanbang_ItemClick(object sender, ItemClickEventArgs e)
        {
            foreach (var x in MdiChildren) if (x is Catalog.FrmVanbang) { x.Activate(); return; }
            var frm = new Catalog.FrmVanbang() { MdiParent = this };
            frm.Show();
        }

        private void btnTieng_ItemClick(object sender, ItemClickEventArgs e)
        {
            foreach (var x in MdiChildren) if (x is Catalog.FrmNgonngu) { x.Activate(); return; }
            var frm = new Catalog.FrmNgonngu() { MdiParent = this };
            frm.Show();
        }

        private void btnQuocgia_Tinh_ItemClick(object sender, ItemClickEventArgs e)
        {
            foreach (var x in MdiChildren) if (x is Catalog.FrmTinh) { x.Activate(); return; }
            var frm = new Catalog.FrmTinh() { MdiParent = this };
            frm.Show();
        }

        private void btnQuanhe_ItemClick(object sender, ItemClickEventArgs e)
        {
            foreach (var x in MdiChildren) if (x is Catalog.FrmQuanhe) { x.Activate(); return; }
            var frm = new Catalog.FrmQuanhe() { MdiParent = this };
            frm.Show();
        }

        private void btnTieuchuan_ItemClick(object sender, ItemClickEventArgs e)
        {
            foreach (var x in MdiChildren) if (x is Catalog.FrmTieuchuan) { x.Activate(); return; }
            var frm = new Catalog.FrmTieuchuan() { MdiParent = this };
            frm.Show();
        }

        private void btnUngvien_ItemClick(object sender, ItemClickEventArgs e)
        {
            foreach (var x in MdiChildren) if (x is Ungvien.FrmUngvien) { x.Activate(); return; }
            var frm = new Ungvien.FrmUngvien() { MdiParent = this };
            frm.Show();
        }
    }
}